<template>
    <div>
      <table>
        <tr>
          <td>
            商品名称
          </td>
          <td>
            商品图片
          </td>
          <td>
            商品价格
          </td>
          <td>
            评论数
          </td>
<!--<td>-->
<!--            用户名-->
<!--          </td>-->

        </tr>

        <tr v-for="item in dinglist">
          <td>
            {{ item.gid.name }}

          </td>
          <td>
<!--            {{ item.img }}-->
            <img :src="'http://127.0.0.1:8000'+item.gid.img" width="50" height="50">

          </td>
          <td>
            {{ item.gid.price }}

          </td>
<td>
            {{ item.gid.count }}

          </td>
<!--<td>-->
<!--            {{ item.uid.name }}-->

<!--          </td>-->


        </tr>
        <tr>
          <td>
            用户名
          </td>
          <td>评论</td>
        </tr>
        <tr v-for="i in detail_list">

          <td>{{ i.uid.name }}</td>
          <td>{{ i.count }}</td>
        </tr>
      </table>
    </div>
</template>

<script>
  import axios from 'axios'
    export default {
        name: "show",
        data(){
          return{
            dinglist:[],

          }
        },
        mounted() {
          var detail = localStorage.getItem('detail');
          var ids = this.$route.query.id;

          axios({
            url:'http://127.0.0.1:8000/showdetail/',
            method:'get',
            params:{'ids':ids}

          }).then(res=>{

            this.dinglist = res.data.dinglist;
            this.detail_list = res.data.detail_list;
            console.log(res);
            console.log(dinglist);
          })
        },


    }
</script>

<style scoped>

</style>
